<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.wxisme.ssm.po.Album" %>
<%@page import="com.wxisme.ssm.po.Photo" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
	<meta name="author" content="Luka Cvrk - www.solucija.com" />
	<meta name="description" content="Site Description" />
	<meta name="keywords" content="site, keywords" />
	<meta name="robots" content="index, follow" />
	<link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="css/side.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="css/button.css" />
	<title>welcome</title>
	<script src="${pageContext.request.contextPath}/js/check.js" type="text/javascript"></script>
	
	<%
	String username = (String)session.getAttribute("username");
	if(username == null) {
		response.sendRedirect(basePath + "login.jsp");
	}
	%>
	
	<%
	    //读取用户的此相册信息
		Map<Album, List<Photo>> userLoadingMap = (Map<Album, List<Photo>>) session.getAttribute("userLoadingMap");
		List<Album> albumList = new ArrayList<Album>();
		for(Album album : userLoadingMap.keySet()) {
			albumList.add(album);
		}
	%>


  </head>
  
  <body>
  
	<div class="backwhite">
	<div class="header">
		<div id="search">
			<form action="">
				<fieldset>
					<input type="text" class="field" value="" placeholder="搜索"/>
					<input type="submit" class="buttons" value="" />
				</fieldset>
			</form>
		</div>
		<ul id="menu">
			<li><a href="welcome.jsp">首页</a></li>
			<!-- <li><a href="login.jsp">登录</a></li> -->
			<!-- <li><a href="register.jsp">注册</a></li> -->
			<li><a href="about.jsp">关于</a></li>
			<li><a href="photowall.jsp">照片墙</a></li>
			<li><a href="personal.jsp">个人中心</a></li>
			<li>
			<form action="${pageContext.request.contextPath}/logout.action" method="post">
			<div class="logout">
			<input class="inputbutton" type="submit" name="submitlogout" value="退出/切换"/>
		    </div>
			</form>
			
			</li>
		</ul>
	</div>


		
		
		<form onsubmit="return checkDeletAlbum();"  method="post" action="${pageContext.request.contextPath}/deleteAlbum.action">
		<div class="createAlbumForm">
		
		<font face="Microsoft YaHei" size="4px" color="black">
		选择要删除的相册吧！
		</font>
		<br/><br/><br/>
		
		<%
		int i = 0;
		for(Album album : albumList) {
			i ++;
		%>
		<input style="width:20px;height:20px;font-family:Microsoft YaHei;" type="checkbox" name="deletingAlbum" value="<%=album.getPathName()%>"/>
		<%=album.getAlbumName() %>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
		<%
			if(i % 5 == 0) {
			%>
			<br/><br/>
			<% 
			}
		}
		 %>
		</div>
		
		<div class="createAlbumFormButton">
		<input style="color:red"; class="button-circle button-flat-primary buttonpoint";  type="submit" name="submitform" value="删除"/>
		</div>
		</form>
		
		
		
	</div>
	

	<div id="promo">
		<div class="wrap">
			
			<div id="footer">
				 <p><a href="#" target="_blank">关于</a>|免责声明：部分素材来自互联网，如有侵权请告知。|欢迎交流：850885154@qq.com</p>
				<p>Copyright &copy; 2015 &minus; 王旭 &minus; Design: &minus; <a href="http://www.cnblogs.com/wxisme/" target="_blank">wxisme</a></p>
			</div>
		</div>
	</div>
	
</body>
</html>
